package com.singzi.algorithm;

import org.junit.Test;

import java.util.Arrays;

public class KMPTest {
    public static void main(String[] args) {
        KMP kmp = new KMP();
        String s = "abaabaa";
        String s1 = "abaababa";
        int n = kmp.strStr(s1, s);
        System.out.println(n);
    }
    @Test
    public void test01()
    {
        KMP kmp = new KMP();
        String str = "abadaba";

        int[] next = new int[str.length()];

        kmp.getNext(next,str);
        System.out.println(Arrays.toString(next));
    }

}
